package json

import (
	"github.com/gin-gonic/gin"
	"poem-server/comm/result"
)

func BindJson(obj any, ctx *gin.Context) {
	err := ctx.ShouldBindJSON(obj)
	if err != nil {
		result.Fail("参数有误，请检查参数重新请求", ctx)
		ctx.Next()
		return
	}
}
